import request from "@/utils/request";

// 查询相册图片列表
export function listPhoto(query) {
  return request({
    url: "/blog/photo/list",
    method: "get",
    params: query,
  });
}

// 查询相册图片详细
export function getPhoto(photoId) {
  return request({
    url: "/blog/photo/" + photoId,
    method: "get",
  });
}

// 新增相册图片
export function addPhoto(data) {
  return request({
    url: "/blog/photo",
    method: "post",
    data: data,
  });
}

// 修改相册图片
export function updatePhoto(data) {
  return request({
    url: "/blog/photo",
    method: "put",
    data: data,
  });
}

// 修改相册图片状态
export function changePhotoStatus(photoId, status) {
  const data = {
    photoId,
    status,
  };
  return request({
    url: "/blog/photo/changeStatus",
    method: "put",
    data: data,
  });
}

// 删除相册图片
export function delPhoto(photoId) {
  return request({
    url: "/blog/photo/" + photoId,
    method: "delete",
  });
}
